<?php

namespace App\Library\Traits\Orm;

use App\Models\AuctionBailModel;
use App\Models\AuctionOrderModel;
use App\Models\PaymentModel;
use App\Models\ShopOrderModel;
use App\Models\ZbBailModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

trait PaymentRelatedOrmTrait
{
    public function payment(): BelongsTo
    {
        return $this->belongsTo(PaymentModel::class, 'id', 'payment_related_id');
    }

    public function auctionOrder(): BelongsTo
    {
        return $this->belongsTo(AuctionOrderModel::class, 'object_id');
    }

    public function shopOrder(): BelongsTo
    {
        return $this->belongsTo(ShopOrderModel::class, 'object_id', 'order_id');
    }

    public function auctionBail(): BelongsTo
    {
        return $this->belongsTo(AuctionBailModel::class, 'object_id');
    }

    public function zbBail(): BelongsTo
    {
        return $this->belongsTo(ZbBailModel::class, 'object_id');
    }
}
